﻿Imports System.IO
Public Class LOGS
    Private Sub LOGS_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Dim di As New IO.DirectoryInfo("\\SERVIDOR1\Publico Administrativo\Público Administrativo\antigo\Logs")
            Dim diar1 As IO.FileInfo() = di.GetFiles()
            Dim dra As IO.FileInfo
            For Each dra In diar1
                ListBox1.Items.Add(dra.FullName)
            Next
        Catch EX As Exception
            MsgBox("DIRETÓRIO VAZIO")
        End Try
    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        Try
            Dim fluxoTexto As IO.StreamReader
            fluxoTexto = New IO.StreamReader(ListBox1.SelectedItem.ToString)
            RichTextBox1.Text = fluxoTexto.ReadToEnd
            fluxoTexto.Close()
        Catch EX As Exception
            MsgBox("ERRO AO PREENCHER OS CAMPOS COM AS INFORMAÇÕES " & EX.ToString)
        End Try
    End Sub
End Class